#include<iostream>
#include<algorithm>
#include<vector>

using std::vector;
using std::cin;
using std::cout;
using std::iter_swap;

template<typename T>
void Input(vector<T> &v) {
    size_t size;
    cin >> size;
    v.resize(size);
    for (size_t i = 0; i < size; ++i) {
        cin >> v[i];
    }
}

template<typename T>
void SelectionSort(vector<T> &v) {
    if (!v.size()) {
        return;
    }
    size_t size = v.size() - 1;
    auto end = v.end();
    while (size) {
        iter_swap(max_element(v.begin(), end), (end - 1));
        --end;
        --size;
    }
}

template<typename T>
void Output(const vector<T> &v) {
    for (auto elem : v) {
        cout << elem << " ";
    }
}

int main() {
    vector<int> v;

    Input(v);
    SelectionSort(v);
    Output(v);
}